package com.bzkj.web.controller.wms;

import com.bzkj.basicinfo.domain.basic.WmsBasicBillsTypeEntity;
import com.bzkj.basicinfo.service.WmsBasicBillsTypeService;
import com.bzkj.common.annotation.LogC;
import com.bzkj.common.core.domain.AjaxResult;
import com.bzkj.common.core.domain.R;
import com.bzkj.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Date 2025/01/14 17:09:14
 * @description 单据类型二次细分
 */
@Api(tags="单据分类")
@RestController
@RequestMapping("wms/basic/billsType")
public class WmsBasicBillsTypeController
{
    @Autowired
    private WmsBasicBillsTypeService wmsBasicBillsTypeService;

    /**
     * 获取单据类型二次细分数据tree
     *
     * @return
     */
    @GetMapping("findAllBasicBillsType")
    @ApiOperation("查询接口")
    public R findAllBasicBillsType()
    {
        return wmsBasicBillsTypeService.findAllBasicBillsType();
    }


    /**
     * 新增单据类型二次细分
     *
     * @param wmsBasicBillsTypeEntity
     * @return
     */
    @ApiOperation("新增接口")
    @PostMapping("saveBasicBillsType")
    @LogC(title = "单据分类", businessType = BusinessType.INSERT, pkFieldNames = "stu_class_id",
            tableNames = "wms_basic_bills_type",content = "' 单据分类名称：'+#wmsBasicBillsTypeEntity.billsTypeName"
    )
    public AjaxResult saveBasicBillsType(@RequestBody WmsBasicBillsTypeEntity wmsBasicBillsTypeEntity)
    {
        return wmsBasicBillsTypeService.saveBasicBillsType(wmsBasicBillsTypeEntity);
    }

    /**
     * 修改单据类型二次细分
     *
     * @param wmsBasicBillsTypeEntity
     * @return
     */
    @ApiOperation("修改接口")
    @PutMapping("putBasicBillsType")
    @LogC(title = "单据分类", businessType = BusinessType.UPDATE, pkFieldNames = "id",
            tableNames = "wms_basic_bills_type",content = "'单据分类名称：'+#wmsBasicBillsTypeEntity.billsTypeName"
    )
    public R putBasicBillsType(@RequestBody WmsBasicBillsTypeEntity wmsBasicBillsTypeEntity)
    {
        return wmsBasicBillsTypeService.putBasicBillsType(wmsBasicBillsTypeEntity);
    }

    /**
     * 修改单据类型二次细分状态
     *
     * @param id
     * @param enableStatus
     * @return
     */
    @ApiOperation("状态修改接口")
    @PutMapping("putBasicBillsEnableStatus")
    @LogC(title = "单据分类", businessType = BusinessType.UPDATE, pkFieldNames = "id",
            tableNames = "wms_basic_bills_type"
    )
    public R putBasicBillsEnableStatus(@RequestParam Integer id, @RequestParam Integer enableStatus)
    {
        return wmsBasicBillsTypeService.putBasicBillsEnableStatus(id, enableStatus);
    }

}
